<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
  <head>
  <style>
.fontdaxiao {
	font-size: 12px;
}

.tableAF {
	
}

.tableAF tr th {
	border: 1px;
	border-color: #EDEDED;
	border-style: solid;
}

.tableAF tr td {
	border: 1px;
	border-top: 0px;
	border-color: #EDEDED;
	border-style: solid;
}

.rowsOne {
	background-color: white;
}

.rowsTwo {
	background-color: #7CC5E5;
}

.rowsThree {
	background-color: #F5F5F5;
}
</style>
<script src="<%=basePath%>backgroundManager/js/jquery-1.4.4.js" type="text/javascript"></script>
<script type="text/javascript">
function chooseChannelName(trNum) {
	var a = document.getElementById("channelTableABC");
	for ( var i = 1; i < a.rows.length; i++) {
		a.rows[i].className = "rowsOne";
	}
	trNum.className = "rowsTwo";
	parent.$.returnValue = trNum.cells[0].innerHTML + "|:,:|" +trNum.cells[1].innerHTML;
}
function trMouseOver(trNum) {
	if (trNum.className != "rowsTwo") {
		trNum.className = "rowsThree";
	}
}
function trMouseOut(trNum) {
	if (trNum.className != "rowsTwo") {
		trNum.className = "rowsOne";
	}
}


</script>
  
  </head>
  <body>
<div class="pageContent">
	<table id="channelTableABC" width="100%" layoutH="65"
		class="tableAF fontdaxiao" cellpadding="0px" cellspacing="0">
		<thead>
			<tr style="background-image: url('backgroundManager/aoll81.jpg')">
				<th width="33%" align="center">
					渠道名称
				</th>
				<th width="27%" align="center">
					渠道别名
				</th>
				<th width="20%" align="center">
					类别
				</th>
				<th width="20%" align="center">
					物流模式
				</th>
			</tr>
		</thead>
		<tbody id="channelbody">
			<c:forEach items="${requestScope.channelList}" var="channel">
			<tr onclick="chooseChannelName(this)" onmouseover="trMouseOver(this)" onmouseout="trMouseOut(this)">
				<td style="display: none;">${channel.channelNumber}</td>
				<td align="center">${channel.channelName}</td>
				<td align="center">${channel.channelAliAs}</td>
				<td align="center">${channel.className}</td>
				<td align="center">${channel.modelName}</td>
			</tr>
			</c:forEach>
		</tbody>
	</table>
</div>
<script type="text/javascript">
(function(){
	var len = $("#channelbody tr").length;
	for(var i=0;i<len;i++){
		switch($("#channelbody tr:eq("+i+") td:eq(4)").html()){
			case "PT":
				$("#channelbody tr:eq("+i+") td:eq(4)").html("国际小包");
				break;
			case "IE":
				$("#channelbody tr:eq("+i+") td:eq(4)").html("国际快递");
				break;
			case "DC":
				$("#channelbody tr:eq("+i+") td:eq(4)").html("国内快递");
				break;
			case "AT":
				$("#channelbody tr:eq("+i+") td:eq(4)").html("空运");
				break;
			case "SG":
				$("#channelbody tr:eq("+i+") td:eq(4)").html("海运");
				break;
			case "WG":
				$("#channelbody tr:eq("+i+") td:eq(4)").html("仓储");
				break;
		}
	}
})();
</script>
</body>
</html>